@layout("/common/_container.html"){
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <div class="form-horizontal">

            <div class="row">
                <div class="col-sm-6 b-r">
                            <#select name="渠道公司" id="channelSuperId" underline="true">
                            </#select>
                            <#select name="收支类型" id="costType" underline="true">
                                <option value="支出" selected>支出</option>
                                <option value="收入">收入</option>
                            </#select>
                            <#input id="amount" name="金额"/>
                            <div style="display: none;">
                                <#input id="channelSuperName" name="名称" nderline="true"/>
                            </div>


                </div>

                <div class="col-sm-6">
                            <#select name="对公/私" id="publicPrivate" underline="true">
                                <option value="对公" selected>对公</option>
                                <option value="对私">对私</option>
                            </#select>
                            <#select name="支付类型" id="payType" underline="true">
                                <option value="预付充值" selected>预付充值</option>
                                <option value="投放消费">投放消费</option>
                            </#select>
                            <#input id="info" name="详细" underline="true" style="display:none"/>
                </div>
            </div>

            <div class="row btn-group-m-t">
                <div class="col-sm-10">
                    <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="CostChannelInfoDlg.addSubmit()"/>
                    <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="CostChannelInfoDlg.close()"/>
                </div>
            </div>
        </div>

    </div>
</div>
<script src="${ctxPath}/static/modular/finance/costChannel/costChannel_info.js"></script>
<script>
    $.ajax({
        type: "post",
        url: "/channelSuper/queryChannelList",
        data: {},
        dataType: "json",
        success: function(data){
            $('#channelSuperName').val(data[0].channelName)
            for(var i=0;i<data.length;i++) {
                $('#channelSuperId').append('<option value="'+data[i].id+'">'+data[i].channelName+'</option>')
            }
        },
        error: function(err) {
            console.log(err)
        }
    });
    $('#channelSuperId').change(function(){
        $('#channelSuperName').val($('#channelSuperId option:selected').html())
    })
    $('#payType').change(function(){
        if($(this).val() == '投放消费') {
            $('#publicPrivate').html('<option value="--" selected>--</option>')
        } else {
            $('#publicPrivate').html('<option value="对公" selected>对公</option><option value="对私">对私</option>')
        }
    })
</script>
@}
